package com.sugar.psych.assessment.module.business.controller.admin.psychquestionbank.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;

import javax.validation.constraints.NotNull;

import static com.sugar.psych.assessment.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 心理测评题库 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PsychQuestionBankRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "6341")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("标题")
    private String title;

    @Schema(description = "题库类型（字典表：business_psych_question_bank_type）", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("题库类型（字典表：business_psych_question_bank_type）")
    private String riskLevel;

    @Schema(description = "提取题目数", requiredMode = Schema.RequiredMode.REQUIRED, example = "7647")
    @ExcelProperty("提取题目数")
    private Integer extractCount;

    @Schema(description = "提取类型（0固定 1随机）", requiredMode = Schema.RequiredMode.REQUIRED, example = "7647")
    @ExcelProperty("提取类型（0固定 1随机）")
    private Boolean extractType;

    @Schema(description = "有效时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "7647")
    @ExcelProperty("有效时间")
    @JsonSerialize(using = LocalDateTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime validTime;

    @Schema(description = "状态（0正常 1禁用）", requiredMode = Schema.RequiredMode.REQUIRED, example = "7647")
    @ExcelProperty("状态（0正常 1禁用）")
    private Boolean status;

    @Schema(description = "是否置顶（0否 1是）", requiredMode = Schema.RequiredMode.REQUIRED, example = "7647")
    @ExcelProperty("是否置顶（0否 1是）")
    private Boolean isTop;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

}